<%
	Calendar calendar = Calendar.getInstance();
	calendar.add(Calendar.MINUTE, -30);
	SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-M-dd HH:mm:ss");
	WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(request.getSession().getServletContext());
	HibernateTemplate template = context.getBean("hibernateTemplate",HibernateTemplate.class);
	Session sessionDb = template.getSessionFactory().openSession();
	String sql = "select count(*) from bis_bank_main_order o where  1=1 and  o.total_check_times <1 and o.last_check_bill_time>= TO_DATE('"+dateFormat.format(calendar.getTime()).toString()+"','YYYY-MM-DD HH24:MI:SS') and o.order_status in(00,01,03,96)";
	SQLQuery query = sessionDb.createSQLQuery(sql);
	BigDecimal count = (BigDecimal)query.list().get(0);
	sessionDb.close();
	response.setHeader("Pragma", "no-cache");
	response.setHeader("Cache-Control", "no-store");
	response.setHeader("Cache-Control", "no-cache");
	response.setHeader("Cache-Control", "must-revalidate");
	response.setDateHeader("Expires", 0);
	out.print(count.intValue() > 0 ? "error" : "ok");
%><%@ page language="java"  pageEncoding="UTF-8" import="org.hibernate.*,org.springframework.web.context.support.WebApplicationContextUtils,org.springframework.web.context.WebApplicationContext,java.text.SimpleDateFormat,java.util.Calendar,java.util.Date,org.springframework.orm.hibernate3.HibernateTemplate,java.math.BigDecimal"%>
